#pragma once

#include "../VirtualButton/VirtualButton.h"
#include "vex.h"

// screen size: 480x240
#define LCD_MAX_X 480
#define LCD_MAX_Y 240
#define SCREEN_MAX_HEIGHT LCD_MAX_Y
#define SCREEN_MAX_WIDTH LCD_MAX_X

void buttons_init();
void buttons_show_up();
void buttons_show_hide();

void screen_display_choose();
void auto_start_btn_func();
void imu_recalibrate_func();
void run_auto_background();

void clear_display_area();
void display_manager_thread_routine();
void update_auto_info_display();
void update_side_role_button_according_to_auto_info();
/////////////////////////////////////////
enum class Display_Page {
  sensor_info = 0,
  controller_axis_info,
  motor_port_info,
  sensor_port_info,

  //以下页面保留
  max_info,         //仅仅用来保存最大页码数
  auto_full_screen, //供其他特写显示
};

extern Display_Page cur_page;
extern Display_Page last_normal_page;
extern bool display_cleared;

extern bool full_screen_using;  //全屏正在被使用
extern bool page_manager_using; //管理员正在使用
extern bool page_manager_stop_displaying;  //叫停管理员
extern bool full_screen_stop_displaying;   //叫停全屏

void page_up();
void page_down();

void reset_disp_ui();
void disp_page_sensors();
void disp_page_ports_sensor();
void disp_page_ports_motor();
void disp_page_axis();
void disp_full_screen();

//全屏显示
void ask_for_full_screen();
void exit_full_screen();

extern BtnRectangle *auto_side_role_btn[4];
extern BtnRectangle *vb_route;
extern BtnRectangle *vb_auto;
extern BtnRectangle *vb_gyro_rec;
extern void draw_ball_color(optical &opt_shoot, int xx = 200, int yy = 30,
                            int rr = 25);
